<#include "../common/layout.ftl"/>
<@layout>
<div width="100%">
	<div class="dxfsqd_title">已接订单</div>
	<div class="dxfsqd_shearch">
		<form method="post" action="/order/acceptedList" class="form-inline">
			<label><span>订单号：</span><input type="text" class="input-medium" style="height: 30px" name="id"/></label> 
			<label><span>工号：</span><input type="text" class="input-medium" style="height: 30px" name="job_number" value="${jobNumber?if_exists}"/></label> 
			<label><span>姓名：</span><input type="text" class="input-medium" style="height: 30px"  name="real_name" value="${name?if_exists}"/></label> 
			<label><span>手机号：</span><input type="text" class="input-medium" style="height: 30px"  name="cell_phone" value="${phone?if_exists}"/></label> 
			<button type="submit" class="btn "><i></i>查询</button>
			<button type="button" class="btn btn-info" onclick="javascript:history.back();">返回</button>
			<#if session.userRole == 'admin' || session.userRole == 'brandManager'>
				<label><span>导出</span><a class="dc_exc"  href="/order/acceptedExcel">导出Excel文件</a></label>
	    	</#if>
		</form>
	</div>
<div class="dxfsqd_table">

	<table class="table table-bordered table-striped">
		<thead>
		  <tr>
			<th scope="col">单号</th>
			<th scope="col">订单来源</th>
			<th scope="col">订单种类</th>
			<th scope="col">客户姓名</th>
			<th scope="col">客户手机</th>
			<th scope="col">客户性别</th>
			<th scope="col">起点</th>
			<th scope="col">目标方向</th>
			<th scope="col">终点</th>
			<th scope="col">里程</th>
			<th scope="col">总金额</th>
			<th scope="col">支付方式</th>
			<th scope="col">订单类型</th>
			<th scope="col">代驾员姓名</th>
			<th scope="col">代驾员工号</th>
			<th scope="col">联系方式</th>
			<th scope="col">下单时间</th>
			<th scope="col">发布时间</th>
			<th scope="col">接单时间</th>
			<th scope="col">使用人</th>
			<th scope="col">使用人姓名</th>
			<th scope="col">代叫</th>
			<th scope="col">备注</th>
			<th scope="col">员工备注</th>
			<th scope="col">操作</th>
		  </tr>
		</thead>
		<tbody>
		<#list page.list as order>
		  <tr>
		  <td><a href="/order/orderDetailView/${order.id}">${order.id}</a></td>
		  <td>
			  <#list session.telLists as tel>
		      <#if tel.company ??>
			  	 <#if order.source==tel.company>
			  	 	${tel.companyname!""}
			  	 </#if>
			  </#if>
			  </#list>
		  </td>
		  <td>
		      <#if order.order_category_type ??>
				<#list session.orderTypeMapList as orderType>
	    			<#if orderType.value == order.order_category_type>
	    			  ${orderType.name}
	    			</#if>
	    		</#list>
    	     </#if>
		  </td>
			<#if order.member_id ??>
				<td>
				  ${order.real_name!""}
				</td>
				<td>
				  ${order.cell_phone!""}
				</td>
				<td>
				  <#if order.sex??>
					  <#if order.sex == 0>
					  	<span class="label label-info">男</span>
					  <#elseif order.sex == 1>
					  	<span class="label label-warning">女</span>
					  <#else>
					  	<span class="label label-inverse">未知</span>
					  </#if>
				  </#if>
				</td>
		  	<#else>
				<td>
				  ${order.real_name2!""}
				</td>
				<td>
				  ${order.cell_phone2!""}
				</td>
				<td>
				  <#if order.sex2??>
					  <#if order.sex2 == 0>
					  	<span class="label label-info">男</span>
					  <#elseif order.sex2 == 1>
					  	<span class="label label-warning">女</span>
					  <#else>
					  	<span class="label label-inverse">未知</span>
					  </#if>
				  </#if>
				</td>
		  	</#if>
			<td>
			 ${order.startpoint!" "}
			</td>
			<td>
			 ${order.userarea!" "}
			</td>
			<td>
			 ${order.endpoint!" "}
			</td>
			<td>
			 ${order.kilometre!" "}
			</td>
			<td>
			 ${order.totalmoney!" "}
			</td>
			<td>
			<#if order.pay_type??>
			 <#if order.pay_type == 0>
			  	<span class="label label-info">现金</span>
			  <#elseif order.pay_type == 1>
			  	<span class="label label-warning">企业支付</span>
			  <#elseif order.pay_type == 2>
			  	<span class="label label-success">VIP支付</span>
			  <#elseif order.pay_type == 3>
			  	<span class="label label-success">免费客户</span>
			  <#else>
			  	<span class="label label-inverse">其他</span>
			  </#if>
			  </#if>
			</td>
			<td>
			   <#if order.from_source ??>
			    <#if order.from_source == "WECHAT">
		  	 	公众号
		  	 	<#elseif order.from_source == "APP">
		  	 	自建
		  	 	<#elseif order.from_source == "ADMIN">
		  	 	强制派单
		  	 	<#elseif order.from_source == "CLIENT">
		  	 	客户端
		  	 	<#elseif order.from_source == "GRAB">
		  	 	员工抢单
		  	 	</#if>
		  	   </#if>
			</td>
			<td>
			 ${order.driver_name!" "}
			</td>
			<td>
			 ${order.job_number!" "}
			</td>
			<td>
			 ${order.driver_phone!" "}
			</td>
			<td>
			 ${order.create_time?string("MM/dd HH:mm")}
			</td>
			<td>
			 ${order.publish_time?string("MM/dd HH:mm")}
			</td>
			<td>
			 ${order.accept_time?string("MM/dd HH:mm")}
			</td>
			<#if order.call_type == 2>
				<td>${order.receive_name!""}</td>
				<td>${order.receive_phone!""}</td>
				<td>是</td>
			<#else>
				<td></td>
				<td></td>
				<td>否</td>
			</#if>
			<td>
			 ${order.remark!" "}
			</td>
			<td>
			 ${order.driver_remark!" "}
			</td>
			<td nowrap>
			     <#if session.userRole == 'admin' || session.userRole == 'brandManager' || session.userRole == 'middleManager' || session.userRole == 'customerCenter'>
				 	<a class="cf" href="/order/addressupdate/${order.id}"><i class="icon-leaf icon-white"></i> 修改</a>
				 </#if>
				 <a class="cf" href="/order/complaint/${order.id}"  >投诉</a>
				 <a class="cf" href="/order/cancelAccepted/${order.id}">取消</a>
				  <!--<a class="btn btn-inverse" href="/order/driverCancel/${order.id}"><i class="icon-remove icon-white"></i> 撤消</a>-->
			</td>
		  </tr>
		</#list>
		</tbody>
	</table>
	<#include "../common/paginate.ftl" />
	<@paginate currentPage=page.pageNumber totalPage=page.totalPage actionUrl="/order/acceptedList/" />
</div>
</div>
</@layout>